<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function(){
            let oBtn = document.getElementById('btn1')
            let oImg = document.getElementById('img1')
            
            oBtn.onclick = async function(){
                // 请求
                let res = await fetch('data/show.png')
                // 解析     把文件加载完才做事
                let data = await res.blob()
                let url = URL.createObjectURL(data)
                oImg.src = url
            }
        }
    </script>
</head>
<body>
    <input type="button" value="读取" id="btn1">
    <img src="" id="img1" alt="">
</body>
</html>